#include<iostream>
#include<algorithm>
#include<cstring>
using namespace std;
typedef long long LL;
const int N = 2e5 + 10;
int a[N];
int n;
int main()
{
	int t;
	cin >> t;
	while (t--) {
		cin >> n;
		memset(a, 0, sizeof(a));
		LL sum = 0;
		for (int i = 1; i <= n; i++) {
			cin >> a[i];
			sum += abs(a[i]);
		}
		int ans = 0;
		int cnt = 0;
		//int idx = 0;
		for (int i = 1; i <= n; i++) {
			if (a[i] < 0)cnt++;
			else if (!a[i])continue;
			else {
				if (cnt)ans++;
				cnt = 0;
			}
		}
		if (cnt)ans++;
		cout << sum << " " << ans << endl;
	}
	return 0;
}